<template>
    <h3>用户信息展示</h3>
    <table>
        <tr>
            <td>登录名称:</td>
            <td>{{ data.UL_Name }}</td>
        </tr>
        <tr>
            <td>登录密码:</td>
            <td>******</td>
        </tr>
        <tr>
            <td>用户类型:</td>
            <td>{{ data.UT_Name }}</td>
        </tr>
        <tr>
            <td>真实姓名:</td>
            <td>{{ data.U_Name }}</td>
        </tr>
        <tr>
            <td>联系方式:</td>
            <td>{{ data.U_Phone }}</td>
        </tr>
        <tr>
            <td>身份证号:</td>
            <td>{{ data.U_IdCard }}</td>
        </tr>
        <tr>
            <td>出生日期:</td>
            <td>{{ data.U_Date }}</td>
        </tr>
        <tr>
            <td>性别:</td>
            <td>{{ data.U_Sex == true ? '男' : '女' }}</td>
        </tr>
        <tr>
            <td>年收入:</td>
            <td>{{ data.U_Income }}</td>
        </tr>
    </table>
</template>

<script setup lang="ts">
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
import { onMounted, ref } from 'vue'
import axios from 'axios';
import { useUserStore } from '../../store/index.ts'

//实例仓库
const userStore = useUserStore();

//创建响应对象
const data = ref({
    UL_Name: '',
    UL_Pwd: '',
    U_Name: '',
    U_Phone: '',
    U_IdCard: '',
    U_Date: '',
    U_Sex: false,
    U_Income: '',
    UT_Name: ''
})

onMounted(() => {
    axios({
        method: "get",
        url: "https://localhost:44305/api/Users/GetUserInfo",
        params: {
            Uid: userStore.UserLoginId
        }
    })
        .then(function (res) {
            data.value = res.data[0];
        })
})

</script>